#-*- coding: utf-8 -*-

class User:

	# 實體變數
	height = 150
	weight = 50
	sex	   = "male"


	def __init__( self, name, age ):
		self.name = name
		self.age  = age
		
	def buy( self, product ):
		print "I buy " + product
		
	def showDetial( self ):
		result = {
			"name" : self.name,
			"age" : self.age,
			"height" : self.height,
			"weight" : self.weight,
			"sex" : self.sex
		}
		return result
		
user   = User( "John", 25 )
detail = user.showDetial	# 將實體方法指派給變數

userDetailMap = detail()
userName = userDetailMap[ "name" ]
userAge  = userDetailMap[ "age" ]
userSex  = userDetailMap[ "sex" ]

print "User Name is: " + userName
print "User Age is: " + str( userAge )
print "User Sex is: " + userSex
